#include "Common.fxh"

cbuffer cbPerObject
{
	float4x4 gWorld;
};

Texture2D gTexture;

struct VS_IN
{
	float3 posL     : POSITION;
	float2 texcoord : TEXCOORD0;
};

struct VS_OUT
{
	float4 posH     : SV_POSITION;
	float2 texcoord : TEXCOORD0;
};
 
VS_OUT VS(VS_IN vIn)
{
	VS_OUT vOut;
	vOut.posH = mul(float4(vIn.posL, 1.0f), gWorld);
	vOut.texcoord = vIn.texcoord;
	return vOut;
}

float4 PS(VS_OUT pIn) : SV_Target
{
	float4 color = gTexture.Sample(gPointSam, pIn.texcoord);
	clip(color.r - 0.5f);
	return color;
}

technique11 Tech0
{
	pass P0
	{
		SetVertexShader( CompileShader( vs_5_0, VS() ) );
		SetGeometryShader( NULL );
		SetPixelShader( CompileShader( ps_5_0, PS() ) );
		
		SetDepthStencilState(DepthOff, 0);
		SetBlendState( NoBlend, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
		SetRasterizerState(CullBack);
	}
}
